<?php 
	// Get param
	$oid   = Yii::app()->request->getParam('oid');
	$pid   = Yii::app()->request->getParam('pid');
	$ctype = Yii::app()->request->getParam('ctype');
	
	echo "<div id='listcomment'>";
		$this->renderPartial('listcomment',array(
			'dataProvider'=>$dataProvider,
		));
	echo "</div>";
	
	$form = $this->beginWidget('CActiveForm',array(
		'id'=>'add-comment',
	));
		echo $form->errorSummary($comment);
		echo $form->textarea($comment,'comment_content',array(
			'maxlength'=>5000,
			'rows'=>'7',
			'cols'=>'120',
			'id'=>'commentBody'
		));
		echo CHtml::ajaxSubmitButton('Save this comment', $this->createUrl('comment/index',array('pid'=>$pid,'oid'=>$oid,'ctype'=>$ctype)) ,array(
			'beforeSend'=>'function() {
				$("#listcomment").addClass("loading");
			}',
			'update'=>'#listcomment',
			'complete'=>'function(){
				$("#listcomment").removeClass("loading");
				$("#commentBody").val("");
			}',
		));
	$this->endWidget();
?>